<template>
  <view class="containter">
      <view class="menu-list" @click="toDetail(item)" v-for="(item, index) in dataList" :key="index">
        <view class="tp">
          <view class="tp-fl">
            <text class="txt1">派单时间：</text>
            <text class="txt2">{{item.created_at}}</text>
          </view>
          <view class="tp-fr" :class="item.is_follow == 1?'active':''">{{item.is_follow == 0?'待接单':'已接单'}}</view>
        </view>
        <view class="middle">
          <view class="middle-item">
            <view class="middle-item-label">
              客户姓名：
            </view>
            <view class="middle-item-value">
              {{item.connect_name}}
            </view>
          </view>
          <view class="middle-item">
            <view class="middle-item-label">
              联系方式：
            </view>
            <view class="middle-item-value">
              {{item.connect_information}}
            </view>
          </view>
          <!-- 				<view class="middle-item">
						<view class="middle-item-label">
							客户级别：
						</view>
						<view class="middle-item-value">
							A（准客户）
						</view>
					</view> -->
        </view>
        <view class="tb">
          <view class="tb-item">
            <text class="tb-item-label">派单人：</text>
            <text class="tb-item-value">{{item.dispatch_username}}</text>
          </view>
          <view class="tb-item">
            <text class="tb-item-label">接单人：</text>
            <text class="tb-item-value">{{item.receive_username?item.receive_username:'无'}}</text>
          </view>
        </view>
      </view>
  </view>
</template>

<script>
  export default {
    props: {
      dataList: {
        type: Array,
        default: []
      }
    },
    data() {
      return {

      }
    },
    methods: {
      toDetail(item) {
        let userInfo = uni.getStorageSync('userInfo');
        // 运营
        if (userInfo.is_operation == 1) {
          uni.navigateTo({
            url: `/pages/order/orderDetail?id=${item.id}`
          })
        }
        // 商务
        if(userInfo.is_seller == 1){
          uni.navigateTo({
            url: `/pages/order/takeOrderDetail?id=${item.id}`
          })
        }
       
      }
    }
  }
</script>

<style lang="scss" scoped>
  .active{
    color: #39C001 !important;
  }
  .containter {
    padding: 24rpx 28rpx;
    box-sizing: border-box;
    background: #F7F8FA;

    .menu-list {
      background: #FFFFFF;
      box-shadow: 0rpx 4rpx 4rpx 0rpx rgba(235, 237, 240, 0.6);
      border-radius: 10rpx;
      padding: 0 28rpx;
      box-sizing: border-box;
      margin-bottom: 30rpx;

      .tp {
        display: flex;
        justify-content: space-between;
        height: 92rpx;
        align-items: center;
        border-bottom: 2rpx solid #eee;

        .tp-fl {
          .txt1 {
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            font-size: 26rpx;
            color: #969799;
          }

          .txt2 {
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            font-size: 26rpx;
            color: #323233;
          }
        }

        .tp-fr {
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          font-size: 28rpx;
          color: #E82D2D;
        }
      }

      .middle {
        padding: 8rpx 0;
        box-sizing: border-box;

        .middle-item {
          display: flex;
          align-items: center;
          margin-top: 20rpx;

          .middle-item-label {
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            font-size: 26rpx;
            color: #969799;
            margin-right: 18rpx;
          }

          .middle-item-value {
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            font-size: 26rpx;
            color: #323233;
          }
        }
      }

      .tb {
        display: flex;
        justify-content: flex-end;

        .tb-item {
          margin-left: 50rpx;
          display: flex;
          align-items: center;
          padding: 28rpx 0;
          box-sizing: border-box;

          .tb-item-label {
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            font-size: 26rpx;
            color: #969799;
          }

          .tb-item-value {
            font-family: PingFangSC, PingFang SC;
            font-weight: 500;
            font-size: 26rpx;
            color: #323233;
          }
        }
      }
    }
  }
</style>